package org.gurms.dao.po.system;

import java.io.Serializable;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name="sys_role_menu")
public class SysRoleMenu implements Serializable {
	private String id;
	private String menuid;
	private int    privilegelist;
	
	private SysRole sysrole;

	@Id
	@GeneratedValue(generator = "uuid")    
	@GenericGenerator(name = "uuid", strategy = "uuid") 
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getMenuid() {
		return menuid;
	}

	public void setMenuid(String menuid) {
		this.menuid = menuid;
	}

	@ManyToOne(fetch=FetchType.LAZY)
	@JoinColumn(name="roleid")
	public SysRole getSysrole() {
		return sysrole;
	}

	public void setSysrole(SysRole sysrole) {
		this.sysrole = sysrole;
	}

	public int getPrivilegelist() {
		return privilegelist;
	}

	public void setPrivilegelist(int privilegelist) {
		this.privilegelist = privilegelist;
	}

	public boolean equals(Object o) {
		if (o == null || !(o instanceof SysRoleMenu)) {
			return false;
		} else {
			SysRoleMenu user = (SysRoleMenu) o;
			if (user.getId() == null) {
				return false;
			} else {
				return user.getId().equals(id);
			}
		}
	}

	public int hashCode() {
		if (id == null)
			return super.hashCode();
		return id.hashCode();
	}
}
